package com.mybatis;

import org.apache.ibatis.io.Resources;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

import java.io.IOException;
import java.io.InputStream;

public class Log4jDemo {
	static Logger logger = Logger.getLogger(Log4jDemo.class);
	public static void main(String[] args) throws InterruptedException, IOException {
		String resource = "log4j.xml";
		InputStream inputStream = Resources.getResourceAsStream(resource);
		PropertyConfigurator.configure(inputStream);
		for (int i = 0; i < 5000; i++) {
			logger.trace("跟踪信息");
			logger.debug("调试信息");
			logger.info("输出信息");
			logger.warn("警告信息");
			logger.error("错误信息");
			logger.fatal("致命信息");
		}
	}
}
